package dto

import (
	"note.zhiwangyunchuang.com/model"
)

type NoteDto struct {
	Id         uint   `json:"id"`
	Title      string `json:"title"`
	Content    string `json:"content"`
	CteateTime string `json:"cteate_time"`
}

func ToNoteDto(note model.Note) NoteDto {
	return NoteDto{
		Id:         note.ID,
		Title:      note.Title,
		Content:    note.Content,
		CteateTime: note.CreatedAt.Format("2006-01-02 15:04"),
	}
}
